﻿using System.Collections.Generic;
using ValidationFramework.Web.MVC.Interfaces;

namespace ValidationFramework.Web.MVC
{
	public class RuleExtractor : IRuleExtractor
	{
		private readonly IRuleExtractionStrategy strategy;

		/// <summary>
		/// Initializes a new instance of the RuleExtractor class.
		/// </summary>
		/// <param name="strategy"></param>
		public RuleExtractor(IRuleExtractionStrategy strategy)
		{
			this.strategy = strategy;
		}

		#region IRuleExtractor Members

		public IList<PropertyRuleInfo> Extract()
		{
			return strategy.GetRules();
		}

		#endregion
	}
}
